<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<p>A set of various image manipulation testing main processing aspects.</p>

<div style="display:none;">
	<div class="t3js-imageProcessing-twinImage-template">
		<div class="t3-install-displaytwinimageimages t3js-imageProcessing-images" style="display:none;">
			<div class="row">
				<div class="col-xs-12 col-md-6">
					<h4>Reference</h4>
					<div class="bg-transparent-emulation">
						<img class="reference"/>
					</div>
				</div>
				<div class="col-xs-12 col-md-6">
					<h4>Your system</h4>
					<div class="bg-transparent-emulation">
						<img class="result"/>
					</div>
				</div>
			</div>
		</div>
		<div class="t3-install-displaytwinimagetextarea t3js-imageProcessing-command" style="display:none;">
			<pre><code class="language-bash t3js-imageProcessing-command-text"></code></pre>
		</div>
	</div>
</div>

<button
	class="btn btn-default t3js-imageProcessing-execute"
	type="button"
>
	Run image tests again
</button>
<hr>


<h3>True type font tests</h3>
<f:be.infobox title="FreeType2 hint" state="-1">
	<p>If the two images below do not look the same, please check your FreeType 2 module.</p>
</f:be.infobox>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingTrueType"></div>
<hr>

<h3>Convert image formats to jpg</h3>
<p>
	This verifies that your ImageMagick installation is able to read the default
	formats <code>jpg</code>, <code>gif</code>, <code>png</code>, <code>tif</code>, <code>pdf</code> and
	<code>ai</code>.
	The tool <code>identify</code> is used to read the pixeldimensions of non-web formats and 'convert' is used to
	read the image and convert it to <code>jpg</code>.
</p>
<f:be.infobox title="Dark images" state="-1">
	<p>
		In case the images appear remarkably darker than the reference images,
		try to set <code>$GLOBALS['TYPO3_CONF_VARS']['GFX']['colorspace'] = sRGB.</code>
	</p>
</f:be.infobox>

<h4>Read jpg</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadJpg"></div>

<h4>Read gif</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadGif"></div>

<h4>Read png</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadPng"></div>

<h4>Read tif</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadTif"></div>

<h4>Read pdf</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadPdf"></div>

<h4>Read ai</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingReadAi"></div>
<hr>

<h3>Writing gif and png</h3>
<p>
	This verifies that ImageMagick is able to write GIF and PNG files.
	The GIF-file is attempted compressed with LZW by the
	<code>\TYPO3\CMS\Core\Imaging\GraphicalFunctions::gifCompress()</code> function.
</p>
<h4>Write gif</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingWriteGif"></div>
<h4>Write png</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingWritePng"></div>
<hr>

<h3>Scaling images</h3>
<p>
	This shows how ImageMagick reacts when scaling transparent GIF and PNG files.
</p>
<h4>gif to gif</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGifToGif"></div>
<h4>png to png</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingPngToPng"></div>
<h4>gif to jpg</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGifToJpg"></div>
<hr>

<h3>Combining images</h3>
<p>
	This verifies that the ImageMagick tools, <code>combine</code>, <code>composite</code>, are able to
	combine two images through a grayscale mask.
</p>
<h4>Combine using a GIF mask with only black and white</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingCombineGifMask"></div>
<h4>Combine using a JPG mask with graylevels</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingCombineJpgMask"></div>
<hr>

<h3>GDlib</h3>
<p>
	This verifies that the GDLib installation works properly.
</p>
<h4>Create simple image</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGdlibSimple"></div>

<h4>Create image from file</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGdlibFromFile"></div>

<h4>Render text with TrueType font</h4>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGdlibRenderText"></div>

<h4>Render text with TrueType font using 'niceText' option</h4>
<f:be.infobox title="Note on 'niceText'" state="-1">
	<p>
		'niceText' is a concept that tries to improve the antialiasing of the rendered type by actually
		rendering the textstring in double size on a black/white mask, downscaling the mask and masking
		the text onto the image through this mask. This involves ImageMagick 'combine'/'composite' and 'convert'.
	</p>
</f:be.infobox>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGdlibNiceText"></div>

<h4>Render 'niceText' with a shadow under</h4>
<f:be.infobox title="Note on 'shadow'" state="-1">
	<p>
		This test makes sense only if the above test had a correct output. But if so, you may not see
		a soft dropshadow from the third text string as you should. In that case you are most likely using
		ImageMagick 5 and should set the flag <code>$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_effects']</code>.
	</p>
</f:be.infobox>
<div class="t3js-imageProcessing-twinContainer" data-test="imageProcessingGdlibNiceTextShadow"></div>
<hr>

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="headingConfiguration">
			<h4 class="panel-title">
				<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseConfiguration" aria-expanded="true" aria-controls="collapseFive" class="collapsed">
					<span class="caret"></span>
					Current configuration
				</a>
			</h4>
		</div>
		<div id="collapseConfiguration" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingConfiguration">
			<div class="panel-body">

				<table class="table table-striped">
					<tr>
						<td>{imageProcessingProcessor} enabled:</td>
						<td>{f:if(condition:imageProcessingEnabled, then:'Yes', else:'No')}</td>
					</tr>
					<tr>
						<td>ImageMagick or GraphicsMagick:</td>
						<td>{imageProcessingProcessor}</td>
					</tr>
					<tr>
						<td>{imageProcessingProcessor} path:</td>
						<td>{imageProcessingPath}</td>
					</tr>
					<tr>
						<td>{imageProcessingProcessor} version:</td>
						<td>{imageProcessingVersion}</td>
					</tr>
					<tr>
						<td>{imageProcessingProcessor} effects enabled:</td>
						<td>{imageProcessingEffects} <span>(Blurring/Sharpening with {imageProcessingProcessor})</span></td>
					</tr>
					<tr>
						<td>GDLib enabled:</td>
						<td>{f:if(condition:imageProcessingGdlibEnabled, then:'Yes', else:'No')}</td>
					</tr>
					<tr>
						<td>GDLib using PNG:</td>
						<td>{f:if(condition:imageProcessingGdlibPng, then:'Yes', else:'No')}</td>
					</tr>
					<tr>
						<td>File Formats:</td>
						<td>{imageProcessingFileFormats}</td>
					</tr>
				</table>
			</div>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="headingVerify">
			<h4 class="panel-title">
				<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseVerify" aria-expanded="true" aria-controls="collapseFive" class="collapsed">
					<span class="caret"></span>
					Verify test results
				</a>
			</h4>
		</div>
		<div id="collapseVerify" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingVerify">
			<div class="panel-body">
				<h4>Verify test results</h4>
				<p>
					This page performs image processing and displays the result. It's a thorough check
					that everything you've configured is working correctly.
				</p>
				<p>
					It's quite simple to verify your installation; Just look down the page, the images
					in pairs should look like each other. If some images are not alike, something is
					wrong. You may also notice warnings and errors if this tool found signs of any problems.
				</p>
				<p>
					The image to the left is the reference image (how it should be) and to the right
					the image made by your server.
				</p>
			</div>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="headingAbout">
			<h4 class="panel-title">
				<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseAbout" aria-expanded="true" aria-controls="collapseFive" class="collapsed">
					<span class="caret"></span>
					About image handling
				</a>
			</h4>
		</div>
		<div id="collapseAbout" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingAbout">
			<div class="panel-body">
				<p>
					TYPO3 is known for its ability to process images on the server.
				</p>
				<p>
					In the backend interface (TBE) thumbnails are automatically generated
					as well as icons, menu items and pane tabs (by GDLib).
					In the frontend all kinds of graphical elements are processed. Typically images are
					scaled down to fit the pages (by ImageMagick) and menu items, graphical headers and
					such are generated automatically (by GDLib + ImageMagick). In addition TYPO3 is able
					to handle many file formats (thanks to ImageMagick), for example TIF, BMP, PCX, TGA,
					AI and PDF in addition to the standard web formats; JPG, GIF, PNG.
				</p>
				<p>
					In order to do this, TYPO3 uses two sets of tools:
				</p>
				<strong>
					ImageMagick / GraphicsMagick:
				</strong>
				<p>
					For conversion of non-web formats to webformats, combining images with alpha-masks,
					performing image-effects like blurring and sharpening.
				</p>
				<p>
					ImageMagick is a collection of external programs on the server called by the exec()
					function in PHP. TYPO3 uses three of these, namely 'convert' (converting fileformats,
					scaling, effects), 'combine'/'composite' (combining images with masks) and 'identify'
					(returns image information). GraphicsMagick is an alternative to ImageMagick and can
					be enabled by setting [GFX][processor] to 'GraphicsMagick'. This is recommended and enabled
					by default. Because ImageMagick and Graphicsmagick are external programs, a requirement
					must be met: The programs must be installed on the server and working. ImageMagick is
					available for both Windows and Unix. The current version is 6+. ImageMagick homepage is
					at <a href="http://www.imagemagick.org/">http://www.imagemagick.org/</a>
				</p>
				<strong>GDLib:</strong>
				<p>
					For drawing boxes and rendering text on images with truetype fonts. Also used for
					icons, menuitems and generally the TypoScript GIFBUILDER object is based on GDlib,
					but extensively utilizing ImageMagick to process intermediate results.
				</p>
				<p>
					GDLib is accessed through internal functions in PHP, you'll need a version of PHP
					with GDLib compiled in. Also in order to use TrueType fonts with GDLib you'll
					need FreeType compiled in as well.
				</p>
			</div>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="headingTestImages">
			<h4 class="panel-title">
				<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTestImages" aria-expanded="true" aria-controls="collapseFive" class="collapsed">
					<span class="caret"></span>
					About test images
				</a>
			</h4>
		</div>
		<div id="collapseTestImages" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTestImages">
			<div class="panel-body">
				<p>
					Test-Image by Rotkaeppchen68 (in de.wikipedia) [<a href="http://www.gnu.org/copyleft/fdl.html">GFDL</a> or
					<a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>],
					<a href="https://commons.wikimedia.org/wiki/File%3AFuBK-Testbild.png">via Wikimedia Commons</a>
				</p>
			</div>
		</div>
	</div>
</div>

</html>
